#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<errno.h>
#include<fcntl.h>
#include<unistd.h> 
#include<pthread.h>


int
main(int argc, char* args[])
{
	FILE* fp_read = fopen("../res/read.txt","r");
	if(fp_read == nullptr){
		perror("open read_file falied");
		exit(errno);
	}
	 

	FILE* fp_write = fopen("../res/write.txt","w");
	if(!fp_write){
		perror("open write_file falied");
		exit(errno);
	}

	int n = 0;
	while(  (n = (fgetc(fp_read))) != EOF ){
		fputc(n,fp_write);	
	}

	if(fclose(fp_read) == -1) strerror(errno);
	if(fclose(fp_write) == -1) strerror(errno);

	exit(0);	
}
